var SectionManager = {
    OnDelete: function(){
        $("a.deleteSection").click(function(){
            if (confirm("Bạn có chắc muốn xóa section: " + $(this).attr("sectionID") + " - " + $(this).attr("sectionName") + " ?") == true){
                $("div#sectionContent div.loading").css("width", $("div#sectionContent").width());
                $("div#sectionContent div.loading").css("height", $("div#sectionContent").height());
                $("div#sectionContent div.loading").css("display", "block");
                var temp = $(this).parent().parent();
                $.ajax({
                    url: "../ajax/ajax.DeleteSection.php?",
                    type: "POST",
                    data: {"sectionID" : $(this).attr("sectionID")},
                    cache: false,
                    dataType: "html",
                    success: function (data) {
                        if(data=="1")
                        {
                            temp.fadeOut('slow');
                        }
                        else
                        {
                            alert("Xảy ra lỗi khi xóa section, vui lòng thử lại");
                        }
                        $("div#sectionContent div.loading").css("display", "none");
                    }
                });
            }
        });
    },
    
    init: function(){
        SectionManager.OnDelete();
    }
} 